// pf_lib.cpp : ���Ӧ����ڵ㡣
//

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <include/pf_sha1.h>



int main()
{
    unsigned char   result[20];
    int                i = 0;
    char   test_string[] = "";
    char   test_string1[] = "hello";
    char   test_string2[] = " world";
    
    pf_sha1_t * p_sha1   = NULL;
    pf_sha1_t * p_sha1_1 = NULL;
  
    p_sha1 = pf_sha1_start();
    pf_sha1_append(p_sha1,(const void*) test_string,(size_t)strlen(test_string));
    pf_sha1_finish(p_sha1,result);
	printf("result not append:");
    for( i=0; i<20; i++ )
	  printf( "%02x", result[i] );
    printf("\n");

    memset(result,0,20);
    
    p_sha1_1 = pf_sha1_start();
    pf_sha1_append(p_sha1_1,(const void*) test_string1,(size_t)strlen(test_string1));
    pf_sha1_append(p_sha1_1,(const void*) test_string2,(size_t)strlen(test_string2));
    pf_sha1_finish(p_sha1_1,result);
	
	printf("result append:");
    for( i=0; i<20; i++ )
	  printf( "%02x", result[i] );
    printf("\n");
	return 0;
}

